<?php

include __DIR__ . '/src/websocket.php';
include __DIR__ . '/src/mysql_lib.php';

$config = array(
	'ws_conf'	=>	array(
		'worker_num' => 4,    //worker process num
	    'backlog' => 128,   //listen backlog
	    'max_request' => 50,
	    'dispatch_mode'=>1, 
	),
	'db_conf'	=>	array(
		'host'	=>	'127.0.0.1',
		'user'	=>	'root',
		'password'	=>	'111111',
		'db'	=>	'xiangwei_live',
		'poolsize'	=>	20
	)
);


$server = new \Src\WebSocket('0.0.0.0',9502,$config,new \Src\MysqlLib($config['db_conf']));

$server->run();